﻿using System;
using System.Net;
using Ping.Server.Cron;

namespace Ping.Server
{
	internal class Program
	{
		private static void Main(string[] args)
		{
			var address = IPAddress.Parse("192.168.11.2");
			var ep = new IPEndPoint(address, 1337);

			var blackList = new Blacklist();
			var scheduler = new CronJobScheduler();
			var server = new Server(ep, blackList);
			var status = new Status(server);

			scheduler.Add(new CronJob("Blacklist Cleanup", TimeSpan.FromHours(1), blackList.Cleanup));
			scheduler.Add(new CronJob("Status Log", TimeSpan.FromMinutes(30), status.Write));

			scheduler.Start();
			server.Start();
		}
	}
}